package fan.project3_pksystem.Service;

import fan.project3_pksystem.Mapper.UserMapper;
import fan.project3_pksystem.Module.UserInfo;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserService {

    @Autowired
    UserMapper userMapper;

//    public UserInfo selectUserById(int id) {
//        return userMapper.selectUserInfoById(id);
//    }

    public UserInfo selectUserByName(String name) {
        return userMapper.selectUserInfoByName(name);
    }

    public boolean registUser(String userName, String password) {
        int register = userMapper.register(userName, password);
        return register==1;
    }
}
